typedef struct tag_queue queue_t;
typedef enum tag_queue_status queue_status_t;

typedef struct tag_work_task {
    unsigned long task_id;
    struct tag_work_task *next;
    int data;
} work_task_t;

enum tag_queue_status {
    QUEUE_STATE_RUNNING = 0,
    QUEUE_STATE_STOPPING,
    QUEUE_STATE_STOPED
};

queue_t *queue_create(size_t cap);
int queue_destory(queue_t *queue);
work_task_t *queue_alloc_data(queue_t *queue);
void queue_free_task(queue_t *queue, work_task_t *data);
int queue_put(queue_t *queue, work_task_t *task);
work_task_t *queue_take(queue_t *queue);
void queue_notify_all(queue_t *queue);
